package com.ty.provider;

import com.ty.dto.Luo;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TopicProvider {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(Luo luo)
    {
        // 发送信息
        rabbitTemplate.convertAndSend( "Topic-ex", luo.getName(), luo);
        System.out.println("发送信息: " + luo);
    }



}
